package com.example.demo.aop;

import org.springframework.stereotype.Component;

/**
 * @author Rocket
 * @version 10.0.1
 * @date 2021-08-29 9:40 AM
 */
@Component
public class ArithmCalculator implements ICalculator {

    @Override
    public Double add(Double x, Double y) {
        return x + y;
    }

    @Override
    public Double addError(Double x, Double y) throws RuntimeException {
        if(x < 3) {
            throw new RuntimeException("Parameter x is less than 3");
        }
        return x + y;
    }
}
